 #include <stdio.h>

const char *dev="/dev/pts/0";

int main()
{
    int cnt = 10;
    FILE *fp = fopen(dev, "w");
    if(fp == NULL){
        printf("open %s error!\n", dev);
        return 1;
    }
    while(cnt--)
    {
        fprintf(fp, "hello bit, hello %d\n", cnt);
        sleep(1);
    }
    fclose(fp);
    return 0;
}